package cn.hznc.controller.service.order.logic;

import cn.hznc.vo.CraftParamVo;
import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.List;

/**
 * 业务模型(无删除业务，直接覆盖相当于删除)
 *
 * @Author Administrator
 * @Date 2023/3/21 17:22
 */
@Getter
@Setter
public class OrderCraftDo {
    private List<CraftParamVo> createElement= new ArrayList<>();
    private List<CraftParamVo> updateElement= new ArrayList<>();
    private List<CraftParamVo> totalElement= new ArrayList<>();


    /**
     * 添加新增的原素
     *
     * @param element element
     * @return boolean
     */
    public boolean addCreateElement(CraftParamVo element){
        return createElement.add(element);
    }

    /**
     * 添加新增的原素
     *
     * @param element element
     * @return boolean
     */
    public boolean addCreateElement(List<CraftParamVo> element){
        return createElement.addAll(element);
    }

    /**
     * 添加新增的原素
     *
     * @param element element
     * @return boolean
     */
    public boolean addUpdateElement(CraftParamVo element){
        return updateElement.add(element);
    }

    /**
     * 添加所有元素
     *
     * @return
     */
    public boolean addAllElement(){
        totalElement.addAll(createElement);
        totalElement.addAll(updateElement);
        return Boolean.TRUE;
    }
}
